import { request } from 'umi';
import type {LogItem} from './data';


// 获取角色的所有信息（主页面）
export async function queryLog(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: Record<string, any>,
) {
  return request<{
    data: LogItem[];
    total?: number;
    success?: boolean;
  }>('/api/user/logs', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {})
  });
}

// 删除日志
export async function deleteLog(data: { key: number[] }, options?: Record<string, any>) {
  return request<Record<string, any>>('/api/user/logs', {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}
